#ifndef	HALINPUTS_H
#define	HALINPUTS_H


/* Includes */
#include "stdtypedef.h"
#include "MALioapi.h"
#include "MALADC.h"

/* Types definition */
/* typedef */
typedef enum
{
	INVALID,
	VALID
}E_SM_INPUTS_ST;	/* LED States */

typedef enum
{
	SWL_CENTER,
	SWL_RIGHT,
	SWL_LEFT
}E_SM_STWHEEL_ST;	/* Steering Wheel States */

typedef enum
{
	LS_OFF,
	LS_DAYLIGHT,
	LS_ON,
	LS_AUTO
}E_SM_LIGHTSEL_ST;	/* Lighting Selector States */

typedef enum
{
	ALS_OFF,
	ALS_HALF,
	ALS_ON
}E_SM_AMBIENTLS_ST;	/* Ambient Light Selector States */



/* Functions prototypes */
/* get states */
E_SM_LIGHTSEL_ST	Get_LightingSelector_State 		(void);		/* selector leido por adc */
E_SM_AMBIENTLS_ST	Get_AmbientLightSelector_State 	(void);		/* sensor de luz ambiente - adc*/
E_SM_INPUTS_ST 		Get_LeftTurnButton_State 		(void);
E_SM_INPUTS_ST 		Get_RightTurnButton_State 		(void);
E_SM_STWHEEL_ST 	Get_SteeringWheel_State 		(void);		/* potenciometro - adc*/
E_SM_INPUTS_ST 		Get_StopButton_State 			(void);
E_SM_INPUTS_ST 		Get_EmergencyLightsButton_State (void);
E_SM_INPUTS_ST 		Get_ReverseSwitch_State 		(void);
E_SM_INPUTS_ST 		Get_IgnitionSwitch_State 		(void);
E_SM_INPUTS_ST 		Get_HeadlightsBeamModeBtn_State (void);
E_SM_INPUTS_ST Get_HeadlightsContinuousModeBtn_State(void);

/* config inputs */
void Init_LightingSelector_hardware				(void);
void Init_AmbientLightSelector_hardware			(void);
void Init_LeftTurnButton_hardware				(void);
void Init_RightTurnButton_hardware				(void);
void Init_SteeringWheel_hardware				(void);
void Init_StopButton_hardware					(void);
void Init_EmergencyLightsButton_hardware		(void);
void Init_ReverseSwitch_hardware				(void);
void Init_IgnitionSwitch_hardware				(void);
void Init_HeadlightsBeamModeBtn_hardware		(void);
void Init_HeadlightsContinuousModeBtn_hardware	(void);


/* Exported defines */
/*GPIO Pins*/
#define LeftTurnButton					pin_Pxx
#define RightTurnButton					pin_Pxx
#define StopButton						pin_Pxx
#define EmergencyLightsButton			pin_Pxx
#define ReverseSwitch					pin_Pxx
#define IgnitionSwitch					pin_Pxx
#define HeadlightsBeamModeBtn			pin_Pxx
#define HeadlightsContinuousModeBtn		pin_Pxx

/*ADC Pins*/
#define SteeringWheel					pin_PB8
#define AmbientLightSelector			pin_PB9
#define LightingSelector				pin_PB10

#define	value_set_for_bdnc				5

//Defines for Steering Wheel Position
#define SWLEFT	410
#define SWRIGHT	614

//Defines for Lighting Selector
#define LSP1	valor de posicion 1
#define LSP2	valor de posicion 2
#define LSP3	valor de posicion 3
#define LSP4	valor de posicion 4

//Defines for Ambient Light Sensor
#define ALSF 	410//40% del valor del ADC
#define ALSS 	614//60% del valor del ADC
#define ALSE 	818//80% del valor del ADC

#endif